-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(weave): Create a system of defining schema-validated objects #2826
Conversation
Preview this PR with FeatureBee: https://beta.wandb.ai/?betaVersion=df0dffa53ec33d5bbe8e0ba1181fa242de13d9a0 |
...c/components/PagePanelComponents/Home/Browse3/pages/wfReactInterface/baseObjectClassQuery.ts
Outdated
Show resolved
Hide resolved
weave/trace_server/interface/base_object_classes/base_object_registry.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet, excited to see this in action.
from weave.trace_server.interface.base_object_classes import base_object_def | ||
|
||
|
||
class TestOnlyNestedBaseModel(BaseModel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are convenient for testing but if we ever display a registry to the user might be annoying to have to filter these out. I wonder if there is a better way, or have multiple registries, one for tests. punt for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This PR allows developers to define a single pydantic type which is then used in 3 key ways:
set_base_object_class
field on the POST request which will enforce server-side validation of these object payloads.A top level make command
make synchronize-base-object-schemas
ensures the frontend is up to date!With all this infrustructure, you simply define your types once, like:
weave/trace_server/interface/base_object_classes/test_only_example.py
:And you now have:
See
dev_docs/BaseObjectClasses.md
for a more complete discussion